package com.glorysoft.xztpda.ui.trackin

import android.os.Bundle
import androidx.databinding.ViewDataBinding
import com.glorysoft.xztpda.BR
import com.glorysoft.xztpda.R
import com.glorysoft.xztpda.base.BaseActivity
import com.glorysoft.xztpda.databinding.ActivityTrackInDefaultBinding
import com.glorysoft.xztpda.entity.LotInfoEntity

/**
 * FileName: TrackInDefaultActivity
 * Author: XJH
 * Date: 2022/4/12 17:27
 * Description:
 * History:
 */
class TrackInDefaultActivity : BaseActivity<TrackInBaseViewModel,ActivityTrackInDefaultBinding>() {

    override fun layoutId(): Int {
        return R.layout.activity_track_in_default
    }

    override fun initVariableId(): Int {
        return BR.trackInBaseViewModel
    }

    override fun initView(savedInstanceState: Bundle?) {
//        setTitle("开始作业")
        viewModel.lotInfoEntity = intent.getSerializableExtra("LOTINFO") as LotInfoEntity
        setTitle("开始作业" + "-" +viewModel.lotInfoEntity?.lot?.stepdesc)
        addActivity(this)
        setRightListener("提交"){
            viewModel.trackIn("DefaultTrackIn")
        }
    }

    override fun initData() {
        viewModel.defUI.startActivity.observe(this){
            finishAllActivity()
        }
    }
}